<?php

class Report_Urls {

    public static function base_url() {
        $apf = APF::get_instance();
        $base_domain = $apf->get_config("base_domain");
        $url = 'http://' . $base_domain . '/';
        return $url;
    }
    //在职图表
    public static function index_url(){
        $url = self::base_url() . "report/";
        return $url;
    }
    //在职列表
    public static function entry_view_url($fid=0){
        $url = self::base_url() . "report/EntryView/";
        if($fid){
            $url .= "?fid=".$fid;
        }
        return $url;
    }
    //离职图表
    public static function dimission_url($type){
        $url = self::base_url() . "report/dimission/";
        if($type){
            $url .="?type=".$type;
        }
        return $url;
    }
    //离职列表
    public static function dimission_view_url($fid=0,$start=0,$end=0,$type='season'){
        $url = self::base_url() . "report/DimissionView/";
        $url_pr=array();
        $url_pr[] = 'type='.$type;
        if($fid){
            $url_pr[] = 'fid='.$fid;
        }
        if($start){
            $url_pr[] = 'start='.$start;
        }
        if($end){
            $url_pr[] = 'end='.$end;
        }
        if(!empty($url_pr)){
            $url.= "?".implode('&',$url_pr);
        }
        return $url;
    }
    /**
     *
     * @param unknown_type $department_id
     * @param unknown_type $start
     * @param unknown_type $end
     * @return string
     */
    public static function dimission_view_detail($department_id=0,$start,$end,$function_id,$bu_id,$city_id){
        $url = self::base_url() . "report/DimissionDetail/";
        $url .= '?depid='.$department_id.'&start='.$start.'&end='.$end."&function_id=".$function_id."&bu_id=".$bu_id."&city_id=".$city_id;
        return $url;
    }
    //pm
    public static function grade_url(){
        $url = self::base_url() . "report/grade/";
        return $url;
    }
    //setting
    public static function setting_url(){
        $url = self::base_url() . "report/setting/";
        return $url;
    }
    public static function ajax_role_department(){
        $url = self::base_url() . "ajax/GetBuDepartment/";
        return $url;
    }
    public static function ajax_dep_list(){
        $url = self::base_url() . "ajax/GetFunctionBu/";
        return $url;
    }
}